package com.zhouyx.userservice.entity;

/**
 * @title: CarMapper
 * @Author: max.zhou1
 * @Date: 2024/9/19 17:45
 * @Version: 1.0
 **/

import com.zhouyx.userservice.dto.CarDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface CarMapper {

    CarMapper INSTANCE = Mappers.getMapper( CarMapper.class );

    @Mapping(source = "numberOfSeats", target = "seatCount")
    CarDto carToCarDto(Car car);

    @Mapping(source = "seatCount", target = "numberOfSeats")
    Car carDtoToCar(CarDto car);
}
